package com.tedu.controller;

import com.tedu.pojo.Rights;
import com.tedu.service.RightsService;
import com.tedu.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Author：毕龙
 * Date: 2022/9/16 8:47
 */
@RestController
@CrossOrigin
@RequestMapping("/rights")
public class RightsController {

    @Autowired
    private RightsService rightsService;

    /**
     * url:/rights/getRightsList
     * 参数：无
     * 类型：get
     * 返回值：SysResult对象（集合对象）
     */
    @GetMapping("/getRightsList")
    public SysResult getRightsList(){
        //调用业务层的方法
        List<Rights> list = rightsService.getRightsList();
        return SysResult.success(list);
    }

}
